
#pragma once

#include "hge.h"
#include "hgegui.h"
#include "hgecolor.h"

#define GetButton(gui, id) ((ButtonItem*)gui->GetCtrl(id))

class ButtonItem : public hgeGUIObject
{
public:
	
	// Constructor
	ButtonItem(int _id, float x, float y, float width, float height, HTEXTURE pic, int totalPics = 1, DWORD _selectColor = 0xFFA0A0A0);

	// Selects/Unselects the button
	void Select();
	void Unselect();

protected:

	// This sets the texture coordinates
	void SetTexCoord(int totalPics);

	// For updating the screen
	void Render();

	// Mouse button
	bool MouseLButton(bool bDown);

	bool selected;
	hgeQuad button;
	hgeQuad image;
	DWORD selectedColor, unselectedColor;
};